package com.sh.personnel.security.config.handler;

import org.springframework.security.core.Authentication;
import org.springframework.security.web.authentication.AuthenticationSuccessHandler;
import org.springframework.stereotype.Component;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * 登录成功返回的信息
 * @author 林思浩
 * @date 2020/01/05 17:34
 */
@Component
public class MyAuthSuccessHandler extends MyCustomHandler implements AuthenticationSuccessHandler {

    @Override
    public void onAuthenticationSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication) throws IOException {
        this.responseJson(HttpServletResponse.SC_OK, "登录成功", response);
    }

}
